//
//  IntegralViewCell.m
//  Lottery_first
//
//  Created by Guoguo on 2017/5/2.
//  Copyright © 2017年 guoguo. All rights reserved.
//

#import "IntegralViewCell.h"

@implementation IntegralViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        CGFloat border = 1.0f;
        UIView *viewBack = [[UIView alloc] initWithFrame:CGRectMake(0, 0, DEF_DEVICE_WIDTH, DEF_DEVICE_HEIGHT / 16)];
        viewBack.backgroundColor = [UIColor whiteColor];
        [self.contentView addSubview:viewBack];
        
        _lblRank = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, (viewBack.frame.size.width - border * 6) / 8, viewBack.frame.size.height)];
        _lblRank.textAlignment = NSTextAlignmentCenter;
        _lblRank.backgroundColor = [UIColor clearColor];
        _lblRank.font = [UIFont systemFontOfSize:14.0];
        _lblRank.textColor = Guoguo_darkGreyFontColor;
        [viewBack addSubview:_lblRank];
        
        _lblTeam = [[UILabel alloc] initWithFrame:CGRectMake(_lblRank.frame.origin.x + _lblRank.frame.size.width + border, _lblRank.frame.origin.y, (viewBack.frame.size.width - border * 6) * 2 / 8, viewBack.frame.size.height)];
        _lblTeam.textAlignment = NSTextAlignmentCenter;
        [_lblTeam setFont:[UIFont systemFontOfSize:16.0]];
        _lblTeam.textColor = Guoguo_darkGreyFontColor;
        [viewBack addSubview:_lblTeam];
        
        _lblMatchesPlayed = [[UILabel alloc] initWithFrame:CGRectMake(_lblTeam.frame.origin.x + _lblTeam.frame.size.width + border, _lblTeam.frame.origin.y, _lblRank.frame.size.width, viewBack.frame.size.height)];
        _lblMatchesPlayed.textAlignment = NSTextAlignmentCenter;
        [_lblMatchesPlayed setFont:[UIFont systemFontOfSize:16.0]];
        _lblMatchesPlayed.textColor = Guoguo_darkGreyFontColor;
        [viewBack addSubview:_lblMatchesPlayed];
        
        _lblWins = [[UILabel alloc] initWithFrame:CGRectMake(_lblMatchesPlayed.frame.origin.x + _lblMatchesPlayed.frame.size.width + border, _lblMatchesPlayed.frame.origin.y, _lblMatchesPlayed.frame.size.width, viewBack.frame.size.height)];
        _lblWins.textAlignment = NSTextAlignmentCenter;
        [_lblWins setFont:[UIFont systemFontOfSize:16.0]];
        _lblWins.textColor = Guoguo_darkGreyFontColor;
        [viewBack addSubview:_lblWins];
        
        _lblDraws = [[UILabel alloc] initWithFrame:CGRectMake(_lblWins.frame.origin.x + _lblWins.frame.size.width + border, _lblWins.frame.origin.y, _lblWins.frame.size.width, viewBack.frame.size.height)];
        _lblDraws.textAlignment = NSTextAlignmentCenter;
        [_lblDraws setFont:[UIFont systemFontOfSize:16.0]];
        _lblDraws.textColor = Guoguo_darkGreyFontColor;
        [viewBack addSubview:_lblDraws];
        
        _lblLosses = [[UILabel alloc] initWithFrame:CGRectMake(_lblDraws.frame.origin.x + _lblDraws.frame.size.width + border, _lblDraws.frame.origin.y, _lblDraws.frame.size.width, _lblDraws.frame.size.height)];
        _lblLosses.textAlignment = NSTextAlignmentCenter;
        [_lblLosses setFont:[UIFont systemFontOfSize:16.0]];
        _lblLosses.textColor = Guoguo_darkGreyFontColor;
        [viewBack addSubview:_lblLosses];
        
        _lblPoints = [[UILabel alloc] initWithFrame:CGRectMake(_lblLosses.frame.origin.x + _lblLosses.frame.size.width + border, _lblLosses.frame.origin.y, _lblLosses.frame.size.width, _lblLosses.frame.size.height)];
        _lblPoints.textAlignment = NSTextAlignmentCenter;
        [_lblPoints setFont:[UIFont boldSystemFontOfSize:16.0]];
        _lblPoints.textColor = Guoguo_darkGreyFontColor;
        [viewBack addSubview:_lblPoints];
    }
    return self;
}

@end
